namespace lianxi {
    interface User {
        id: number;
        username: string;
        email: string;
        isActive: boolean;
    }
    const user: User = {
        id: 1,
        username: 'sdfsdf',
        email: 'sdfsdf',
        isActive: true
    };

    interface Product {
        name: string
        price: number
        description?: string
    }

    const product: Product = {
        name: 'sdfsdf',
        price: 123123

    }

    interface MathOperation {
        (a: number, b: number): number
    }
    const add: MathOperation = (a, b) => a + b

    interface StringArray {
        [index: number]: string
    }
    const names: StringArray[] = ['Alice', 'BOb', 'Charlie']
    names.forEach(element => {
        console.log(element);

    });

    interface Coordinates {
        readonly x: number;
        readonly y: number;
    }

    type ReadonlyCoordinates = Readonly<Coordinates>

    const point: ReadonlyCoordinates = { x: 10, y: 20 }
    // point.x = 120


    interface Counter {
        value: number
        (): number
    }

    const counter: Counter = (() => {
        let count = 0
        const c = () => count++
        c.value = 0
        return c
    })()

    interface StringDictionary {
        [key: string]: string
    }

    const name = '清华大学'
    const slogan = '君不见，黄花之水天上来奔流，奔流到海不复回。'
    function getTel() {
        return '1231231233'
    }
    function getCities() {
        return ['北京', '上海', '深圳', '成都', '武汉', '⻄安']
    }


    exports.name = name
    exports.slogan = slogan
    exports.getTel = getTel
    exports.getCities = getCities

}